var t = require;
var e = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = (function () {
    function t() {}
    return (
        (t.encode = function (t) {
            for (var e = new Uint8Array(t), o = e.length, n = "", a = 0; a < o; a += 3)
                (n += r[e[a] >> 2]),
                    (n += r[((3 & e[a]) << 4) | (e[a + 1] >> 4)]),
                    (n += r[((15 & e[a + 1]) << 2) | (e[a + 2] >> 6)]),
                    (n += r[63 & e[a + 2]]);
            return (
                o % 3 == 2
                    ? (n = n.substring(0, n.length - 1) + "=")
                    : o % 3 == 1 && (n = n.substring(0, n.length - 2) + "=="),
                n
            );
        }),
        (t.decode = function (t) {
            var e = 0.75 * t.length,
                o = t.length,
                n = 0,
                r = 0,
                i = 0,
                s = 0,
                c = 0;
            "=" === t[t.length - 1] && (e--, "=" === t[t.length - 2] && e--);
            for (var l = new ArrayBuffer(e), u = new Uint8Array(l), p = 0; p < o; p += 4)
                (r = a[t.charCodeAt(p)]),
                    (i = a[t.charCodeAt(p + 1)]),
                    (s = a[t.charCodeAt(p + 2)]),
                    (c = a[t.charCodeAt(p + 3)]),
                    (u[n++] = (r << 2) | (i >> 4)),
                    (u[n++] = ((15 & i) << 4) | (s >> 2)),
                    (u[n++] = ((3 & s) << 6) | (63 & c));
            return l;
        }),
        t
    );
})();
o.default = n;
for (
    var r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", a = new Uint8Array(256), i = 0;
    i < r.length;
    i++
)
    a[r.charCodeAt(i)] = i;
